$.fn.extend({
    lazyLoad() {
        window.onscroll = () => {
            this.scrollLoad()
        }
    },
    scrollLoad() {
        let totalShowHeight = (window.innerHeight || document.documentElement.clientHeight) + (document.body.scrollTop || document.documentElement.scrollTop)
        this.each((index, item) => {
            let currentImgHeight = $(item).offset().top;
            if (totalShowHeight > currentImgHeight) {
                $(item).attr("src", $(item).attr("data-original"))
            }
        })
    }
})